package tech.jabari.user.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import tech.jabari.user.entity.User;
import tech.jabari.user.service.UserService;
import tech.jabari.user.service.impl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

import static tech.jabari.constants.UMSConstant.ACCESS_DENY_URL;

@Controller
public class UserDetailController {

    @Autowired
    private UserService userService ;

    @GetMapping("/{idInt}/userDetail.action")
    @ResponseBody
    protected User getUserDetail(@PathVariable("idInt") Integer id)  {
        // 根据id查询用户信息。
        User userDtl = userService.findUserById(id);
        return userDtl;
    }
}
